<%-- 
    Document   : Modulo1UpdateDB
    Created on : 08-oct-2011, 8:37:22
    Author     : PC-01
--%>
<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
<%
        Connection conn = null;
        try {
            String sc = "jdbc:mysql://localhost:3306/upeu?user=root&password=";
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection(sc);
            System.out.println("Conectado");
            //test
            String `User`id=request.getParameter("`User`id");
            String Photo  =request.getParameter("Photo  ");
            String `Name` =request.getParameter("`Name` ");
            String Email =request.getParameter("Email ");
            String Cellular=request.getParameter("Cellular");
            String Login =request.getParameter("Login ");
             String Password =request.getParameter("Password ");
              String Privilege =request.getParameter("Privilege ");
               String ActiveAcount =request.getParameter("ActiveAccount ");
            
            String qry="UPDATE `User` SET Photo  ='"+Photo  +"', `Name` ='"+`Name` +"', Email ='"+Email +"', Cellular='"+Cellular+"', Login ='"+Login +"',Password='"+Password+"',Privilege='"+Privilege+"',ActiveAccount='"+ActiveAccount+"' WHERE `User`id="+`User`id+"";
            PreparedStatement ps=conn.prepareStatement(qry);
            int r=ps.executeUpdate();
            out.println(r+" registros modificados en la tabla `User` "+"<br>");
            
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }
%>
<a href="Modulo1Main.jsp"> Regresar al Menu Principal </a>
    </body>
</html>
